Skip to content

K2 compatibility - #92

Merged
wellingtoncosta merged 2 commits into
mainfrom
wp/k2-compatibility
Aug 17, 2026
Merged

K2 compatibility#92
wellingtoncosta merged 2 commits into
mainfrom
wp/k2-compatibility

Conversation

@wellingtoncosta

Copy link
Copy Markdown
Contributor

Fixes the IrLinkageError on Kotlin 2.x consumers (see #85). It was compiled with Kotlin 1.6.20, which baked an old IR symbol hash for setUnhandledExceptionHook into the klib. Kotlin 2.x consumer can't resolve that symbol, so the stub throws IrLinkageError.

Comment thread gradle/libs.versions.toml Outdated
Comment thread gradle/wrapper/gradle-wrapper.properties Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the project’s build/tooling and multiplatform source declarations to ensure Kotlin 2.x consumers can link the published klib without IrLinkageError (issue #85), primarily by rebuilding with Kotlin 2.x and adjusting Kotlin Gradle plugin APIs for K2.

Changes:

  • Upgraded Gradle wrapper and version catalog to Kotlin 2.2.10, AGP 8.10.0, and Android compileSdk/targetSdk 35.
  • Updated expect/actual declarations for Bugsnag/Crashlytics call wrappers and migrated iOS linker plugins to compilerOptions/compileTaskProvider configuration.
  • Simplified Apple ThreadSafeVar implementation and updated repo hygiene (.kotlin/ in .gitignore), plus minor settings/module include adjustments.

Reviewed changes

Copilot reviewed 17 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
settings.gradle.kts Adjusts included projects and keeps toolchain resolver plugin configuration.
gradle/wrapper/gradle-wrapper.properties Bumps Gradle wrapper to a newer version for Kotlin/AGP compatibility.
gradle/libs.versions.toml Upgrades Kotlin/AGP and Android SDK levels in the version catalog.
build.gradle.kts Updates root plugin application set (notably removes Docusaurus template plugin).
crashlytics/src/commonMain/kotlin/co/touchlab/crashkios/crashlytics/CrashlyticsCalls.kt Makes expect API explicit to align with K2 expect/actual resolution.
crashlytics/src/appleMain/kotlin/co/touchlab/crashkios/crashlytics/CrashlyticsCallsActual.kt Adds actual modifiers to match new expect declarations.
crashlytics/src/androidMain/kotlin/co/touchlab/crashkios/crashlytics/CrashlyticsCallsActual.kt Adds actual modifiers to match new expect declarations.
crashlytics/build.gradle.kts Removes per-module KotlinCompile jvmTarget configuration (leans on existing compilerOptions/AGP config).
crashlytics-ios-link/src/main/kotlin/co/touchlab/crashkios/CrashlyticsLinkPlugin.kt Migrates linker args wiring to compileTaskProvider + compilerOptions.
crashlytics-ios-link/build.gradle.kts Simplifies plugin build by relying on kotlin-dsl rather than kotlin("jvm").
bugsnag/src/commonMain/kotlin/co/touchlab/crashkios/bugsnag/BugsnagCalls.kt Makes expect API explicit to align with K2 expect/actual resolution.
bugsnag/src/appleMain/kotlin/co/touchlab/crashkios/bugsnag/BugsnagCallsActual.kt Adds actual modifiers to match new expect declarations.
bugsnag/src/androidMain/kotlin/co/touchlab/crashkios/bugsnag/BugsnagCallsActual.kt Adds actual modifiers to match new expect declarations.
bugsnag/build.gradle.kts Removes per-module KotlinCompile jvmTarget configuration (leans on existing compilerOptions/AGP config).
bugsnag-ios-link/src/main/kotlin/co/touchlab/crashkios/BugsnagLinkPlugin.kt Migrates linker args wiring to compileTaskProvider + compilerOptions.
bugsnag-ios-link/build.gradle.kts Simplifies plugin build by relying on kotlin-dsl rather than kotlin("jvm").
core/src/appleMain/kotlin/co/touchlab/crashkios/core/ThreadSafeVar.kt Removes strict-memory-model freezing logic for modern Kotlin/Native behavior.
core/build.gradle.kts Removes per-module KotlinCompile jvmTarget configuration (leans on existing compilerOptions/AGP config).
.gitignore Ignores .kotlin/ build cache directory.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@wellingtoncosta
wellingtoncosta merged commit 5636c07 into main Aug 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants